-
Notifications
You must be signed in to change notification settings - Fork 0
feat: show similar books using fuzzy matching when no results found #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a very nice addition, and it makes searching for books a much better experience!
One small thought from testing: when I search for “hary poter”, showing “No books found for this search” and “Books with similar titles” feels a bit unnecessary, since the suggestions are clearly what I was looking for. Also, only 12 books are shown with no pagination, which is a bit annoying since you wanted Harry Potter books and there are more than 12 of them.
At the same time, “No books found for this search” works well when the query is quite different from a title and not just a very small typo.
I have no idea if this can be fixed in a good way. I'll still approve since the experience works well as it is, so these are just small things I noticed.
(I hope this makes sense, it was a bit difficult to describe)
|
Alright, this was quite difficult to get right. I want to (a) let users know we have this functionality, while (b) not taking up too much of the screen space and (c) not being distracting. I think I managed to achieve this combination a little better now. The big title is removed and kept only for screen readers (for accessibility). Also, pagination is always on, and sorting can be chosen only if we get some similar results based on the title. The top-rated books have a predefined sorting (best ratings), so it does not make sense to give the user an option to change this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! This solves exactly what I was talking about. The balance between the factors mentioned is well calibrated now.
I agree that sorting only makes sense when the results come from a search with similar results based on the title
This PR adds fuzzy matching whenever there are no results in the book page. This allows us to show real suggestions, because the search
hary potershows Harry Potter books as suggestions. Fuzzy matching is explained a little more in the issue #92.Some of the code in this pull request has been created with the assistance of AI.
To be merged after #91, because this PR builds upon that one.
Closes #92